import Taro from '@tarojs/taro'
export const logistics = (mode: any) => {
    const access_token = mode.access_token;
    const order_id = mode.orderid;
    const openid = mode.openid;
    const delivery_id = mode.delivery_id;
    const waybill_id = mode.waybill_id;
    // console.log('mode',mode)
    //  const access_token =mode;
    // const order_id = '210047';
    // const openid ='owfdT5ZpaflpzEPIXjO1QtPBqux0';
    // const delivery_id = 'YTO';
    // const waybill_id = 'YT2172217899373';
    new Promise((resolve)=>{
        Taro.request({
            url: `https://api.weixin.qq.com/cgi-bin/express/business/path/get?access_token=${access_token}`,
            data: {
                access_token,
                order_id,
                openid,
                delivery_id,
                waybill_id
            },
            method: "POST",
            success: res => {
                console.log('res',res)
                let data = res.data.path_item_list;
                resolve(data)
            }
           
        })
    })
}